#include <iostream>
#include <vector>
#include <set>
#include <string>
using namespace std;


char * Stringtochar(string str){
	char *s;
	int len = str.length();
	s = new char[len + 1];
	strcpy(s ,str.c_str());
	for(int i = 0; s[i] != '\0'; i++){
		cout << s[i];
	}
	cout << endl;
	return s;
}

void GetWord(char *s){
	string str1[100];
	char temp[10];
	int front = 0;
	int i, j, countmin, countmax;
	countmin = countmax = 0;
	for(i = 0; ; ){
		for(j = 0; s[j] != '\0' ; j++){
			if(s[j] == ' '){
				temp[j-front] = '\0';
				//cout << temp << endl;
				str1[i] = temp;
				for(int k =0; k < i; k++){
					if(str1[k] == str1[i]){
						countmin--;
						break;
					}
				}
				countmin++;
				countmax++;
				front = j+1;
				i++;
			}
			else{
				temp[j-front] = s[j];
			}
		}
		temp[j-front] = '\0';
		str1[i] = temp;
		for(int k =0; k < i; k++){
			if(str1[k] == str1[i]){
				countmin--;
				break;
			}
		}
		countmin++;
		countmax++;
		front = j+1;
		break;
	}
	for(int i = 0 ; str1[i] != "" ; i++){
		cout << str1[i] << endl;
	}

	cout << "The number of the letter is " << countmax << endl;
	cout << "The number of the distinct letter is " << countmin << endl;
	
}


void countDistinctWord(string str) {
	//在此处添加相应代码
	char *s1 = Stringtochar(str);
	GetWord(s1);
}

int main() {
	string str = "hello hello wwor world! Ni world!";
	countDistinctWord(str);
	system("pause");
	return 0;
}